﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;

namespace Honestysoft.Financing.WebUI.Module.Audit
{
    public partial class DocReceivePrint : System.Web.UI.Page
    {
        protected string Url = "";

        protected void Page_Load(object sender, EventArgs e)
        {
            string serverUrl = ConfigurationManager.AppSettings["ReportServerURL"];
            Url = serverUrl + "/R001_1&ID=" + Request.QueryString["ID"] + "&rc:parameters=false";
            btnExit.Attributes.Add("onclick", "window.returnValue=" + (Request.QueryString["IsNew"] == "1" ? "true" : "false") + ";window.close();");

            if (Request.QueryString["IsUse"] == "1")
            {
                btnEdit.Visible = false;
            }
        }

        protected void btnEdit_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["From"] == "ProjectNew")
            {
                Response.Redirect("FirstProjDocReceive.aspx?ID=" + Request.QueryString["ID"] + "&FunctionID=" + Request.QueryString["FunctionID"] + "&IsNew=" + Request.QueryString["IsNew"]);
            }
            else if (Request.QueryString["From"] == "ContractNew")
            {
                Response.Redirect("FirstProjDocReceive.aspx?ID=" + Request.QueryString["ID"] + "&FunctionID=" + Request.QueryString["FunctionID"] + "&IsNew=" + Request.QueryString["IsNew"]);
            }
            else
            {
                Response.Redirect("Bu_DocReceive_Edit.aspx?ID=" + Request.QueryString["ID"] + "&FunctionID=" + Request.QueryString["FunctionID"] + "&IsNew=" + Request.QueryString["IsNew"]);
            }
        }
    }
}